package com.jyh.controller;



import com.jyh.service.StockService_redisson;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author JYH
 * @version 1.0
 * @date 2022/12/8 14:39
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private StockService_redisson stockService;

    //根据商品编号减库存
    @GetMapping("/incr/{productId}")
    public String incr(@PathVariable Integer productId){
        return stockService.decrement(productId);
    }
}
